package com.rockcent.mall.lib.repository;

import com.rockcent.common.domain.enumclass.Whether;
import com.rockcent.mall.lib.domain.AuthTitle;
import com.rockcent.mall.lib.domain.AuthUserResource;
import org.springframework.data.jpa.repository.JpaRepository;
import org.springframework.data.jpa.repository.JpaSpecificationExecutor;
import org.springframework.stereotype.Repository;

import java.util.List;

/**
 * Created by anti on 2016-08-22.
 */
@Repository
public interface AuthUserResourceRepository extends JpaRepository<AuthUserResource, Long>, JpaSpecificationExecutor, AuthUserResourceRepositoryCustom {


    List<AuthUserResource> findByUserAdminId(Long userAdminId);

    List<AuthUserResource> findByResourceIdAndIsDelete(Long resourceId, Whether no);

    List<AuthUserResource> findByMallId(Long mallId);

    List<AuthUserResource> findByMallIdAndUserId(Long mallId, Long userId);

    List<AuthUserResource> findByMallIdAndUserIdAndMerchantId(Long mallId, Long userId, Long merchantId);
}

